package com.meeruu.sg.account.core.api.service;

import com.meeruu.common.model.page.PageResult;
import com.meeruu.sg.account.core.api.constant.AccountGroup;
import com.meeruu.sg.account.core.api.constant.AccountType;
import com.meeruu.sg.account.core.api.constant.PlatformType;
import com.meeruu.sg.account.core.api.dto.request.query.*;
import com.meeruu.sg.account.core.api.dto.response.*;

import java.util.List;
import java.util.Map;

/**
 * 底层账户查询接口
 *
 * @Auther: liwu
 * @Date: 2019/5/15 14:05
 * @Description:
 */
public interface IAccountQueryService extends AccountCoreFacadeBase {


    /**
     * 根据组别查询账户支持的类型
     *
     * @param accountGroup
     * @return
     */
    List<AccountType> getAccountTypeByAccountGroup(AccountGroup accountGroup);

    /**
     * 获取账户
     *
     * @param listAccountQueryRequest
     * @return
     */
    List<? extends AccountResponseDTO> listAccounts(ListAccountQueryDTO listAccountQueryRequest);

    List<? extends AccountResponseDTO> listAccountsByIds(ListAccountByIdsQueryDTO listAccountQueryRequest);


    /**
     * 根据账户编号获取账id
     *
     * @param accountId
     * @param <T>
     * @return
     */
    <T extends AccountResponseDTO> T getAccountByAccountId(String accountId, AccountGroup accountGroup);

    /**
     * 查询用户账号
     *
     * @param userCode
     * @param accountType
     * @param <T>
     * @return
     */
    <T extends AccountResponseDTO> T getUserAccountByUserCodeAndAccountType(String userCode, AccountType accountType);


    /**
     * 查询用户所有账户
     *
     * @param userCode
     * @return
     */
    Map<Integer, UserAccountResponseDTO> getUserAccounts(String userCode);

    /**
     * 批量查询用户账号
     *
     * @param queryDTOS
     * @return
     */
    List<UserAccountResponseDTO> getUserAccountGroup(List<UserAccountQueryDTO> queryDTOS);

    /**
     * 查询商户账号
     *
     * @param merchantCode
     * @param accountType
     * @param <T>
     * @return
     */
    <T extends AccountResponseDTO> T getMerchantAccountByMerchantCodeAndAccountType(String merchantCode, AccountType accountType);

    /**
     * 分页查询账户信息
     *
     * @param <T>
     * @param filter
     * @return
     */
    <T extends AccountResponseDTO, S extends AccountQueryFilterDTO> PageResult<T> getAccountPage(S filter);

    /**
     * 根据账户名称精确查找机构账户
     *
     * @param name 账户名称
     */
    OrgAccountResponseDTO getOrgAccountByName(String name);

    /**
     * 查询资金交易流水
     *
     * @param outBizNo
     * @param platformType
     * @param status
     * @return
     */
    List<FundRequestRecordDTO> getFundRequestRecord(String outBizNo, PlatformType platformType, Integer status);

    /**
     * 看板数据统计
     *
     * @param accountGroup
     * @return
     */
    List<KanBanResponseDTO> kanbanStatistics(Integer accountGroup);

    /**
     * 日终统计
     * @param param
     * @return
     */
    PageResult<AccountDayEndDTO> accountDayEndQueryPage(AccountDayEndQueryPageDTO param);

    List<AccountDayEndDTO> accountDayEndQuery(AccountDayEndQueryPageDTO param);

}
